package edu.three.renderers.shaders;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import edu.cs4730.opengl30cube.R;
import edu.util.RawShaderLoader;

public class ShaderChunk {
    static public String alphamap_fragment = RawShaderLoader.fetch(R.raw.chunk_alphamap_fragment);
    static public String alphamap_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_alphamap_pars_fragment);
    static public String alphatest_fragment = RawShaderLoader.fetch(R.raw.chunk_alphatest_fragment);
    static public String aomap_fragment = RawShaderLoader.fetch(R.raw.chunk_aomap_fragment);
    static public String aomap_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_aomap_pars_fragment);
    static public String begin_vertex = RawShaderLoader.fetch(R.raw.chunk_begin_vertex);
    static public String beginnormal_vertex = RawShaderLoader.fetch(R.raw.chunk_beginnormal_vertex);
    static public String bsdfs = RawShaderLoader.fetch(R.raw.chunk_bsdfs);
    static public String bumpmap_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_bumpmap_pars_fragment);
    static public String clipping_planes_fragment = RawShaderLoader.fetch(R.raw.chunk_clipping_planes_fragment);
    static public String clipping_planes_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_clipping_planes_pars_fragment);
    static public String clipping_planes_pars_vertex = RawShaderLoader.fetch(R.raw.chunk_clipping_planes_pars_vertex);
    static public String clipping_planes_vertex = RawShaderLoader.fetch(R.raw.chunk_clipping_planes_vertex);
    static public String color_fragment = RawShaderLoader.fetch(R.raw.chunk_color_fragment);
    static public String color_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_color_pars_fragment);
    static public String color_pars_vertex = RawShaderLoader.fetch(R.raw.chunk_color_pars_vertex);
    static public String color_vertex = RawShaderLoader.fetch(R.raw.chunk_color_vertex);
    static public String common = RawShaderLoader.fetch(R.raw.chunk_common);
    static public String cube_uv_reflection_fragment = RawShaderLoader.fetch(R.raw.chunk_cube_uv_reflection_fragment);
    static public String defaultnormal_vertex = RawShaderLoader.fetch(R.raw.chunk_defaultnormal_vertex);
    static public String displacementmap_pars_vertex = RawShaderLoader.fetch(R.raw.chunk_displacementmap_pars_vertex);
    static public String displacementmap_vertex = RawShaderLoader.fetch(R.raw.chunk_displacementmap_vertex);
    static public String emissivemap_fragment = RawShaderLoader.fetch(R.raw.chunk_emissivemap_fragment);
    static public String emissivemap_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_emissivemap_pars_fragment);
    static public String encodings_fragment = RawShaderLoader.fetch(R.raw.chunk_encodings_fragment);
    static public String encodings_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_encodings_pars_fragment);
    static public String envmap_fragment = RawShaderLoader.fetch(R.raw.chunk_envmap_fragment);
    static public String envmap_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_envmap_pars_fragment);
    static public String envmap_pars_vertex = RawShaderLoader.fetch(R.raw.chunk_envmap_pars_vertex);
    static public String envmap_vertex = RawShaderLoader.fetch(R.raw.chunk_envmap_vertex);
    static public String fog_vertex = RawShaderLoader.fetch(R.raw.chunk_fog_vertex);
    static public String fog_pars_vertex = RawShaderLoader.fetch(R.raw.chunk_fog_pars_vertex);
    static public String fog_fragment = RawShaderLoader.fetch(R.raw.chunk_fog_fragment);
    static public String fog_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_fog_pars_fragment);
    static public String gradientmap_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_gradientmap_pars_fragment);
    static public String lightmap_fragment = RawShaderLoader.fetch(R.raw.chunk_lightmap_fragment);
    static public String lightmap_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_lightmap_pars_fragment);
    static public String lights_lambert_vertex = RawShaderLoader.fetch(R.raw.chunk_lights_lambert_vertex);
    static public String lights_pars_begin = RawShaderLoader.fetch(R.raw.chunk_lights_pars_begin);
    static public String envmap_physical_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_envmap_physical_pars_fragment);
    static public String lights_phong_fragment = RawShaderLoader.fetch(R.raw.chunk_lights_phong_fragment);
    static public String lights_phong_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_lights_phong_pars_fragment);
    static public String lights_physical_fragment = RawShaderLoader.fetch(R.raw.chunk_lights_physical_fragment);
    static public String lights_physical_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_lights_physical_pars_fragment);
    static public String lights_fragment_begin = RawShaderLoader.fetch(R.raw.chunk_lights_fragment_begin);
    static public String lights_fragment_maps = RawShaderLoader.fetch(R.raw.chunk_lights_fragment_maps);
    static public String lights_fragment_end = RawShaderLoader.fetch(R.raw.chunk_lights_fragment_end);
    static public String logdepthbuf_fragment = RawShaderLoader.fetch(R.raw.chunk_logdepthbuf_fragment);
    static public String logdepthbuf_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_logdepthbuf_pars_fragment);
    static public String logdepthbuf_pars_vertex = RawShaderLoader.fetch(R.raw.chunk_logdepthbuf_pars_vertex);
    static public String logdepthbuf_vertex = RawShaderLoader.fetch(R.raw.chunk_logdepthbuf_vertex);
    static public String map_fragment = RawShaderLoader.fetch(R.raw.chunk_map_fragment);
    static public String map_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_map_pars_fragment);
    static public String map_particle_fragment = RawShaderLoader.fetch(R.raw.chunk_map_particle_fragment);
    static public String map_particle_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_map_particle_pars_fragment);
    static public String metalnessmap_fragment = RawShaderLoader.fetch(R.raw.chunk_metalnessmap_fragment);
    static public String metalnessmap_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_metalnessmap_pars_fragment);
    static public String morphnormal_vertex = RawShaderLoader.fetch(R.raw.chunk_morphnormal_vertex);
    static public String morphtarget_pars_vertex = RawShaderLoader.fetch(R.raw.chunk_morphtarget_pars_vertex);
    static public String morphtarget_vertex = RawShaderLoader.fetch(R.raw.chunk_morphtarget_vertex);
    static public String normal_fragment_begin = RawShaderLoader.fetch(R.raw.chunk_normal_fragment_begin);
    static public String normal_fragment_maps = RawShaderLoader.fetch(R.raw.chunk_normal_fragment_maps);
    static public String normalmap_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_normalmap_pars_fragment);
    static public String packing = RawShaderLoader.fetch(R.raw.chunk_packing);
    static public String premultiplied_alpha_fragment = RawShaderLoader.fetch(R.raw.chunk_premultiplied_alpha_fragment);
    static public String project_vertex = RawShaderLoader.fetch(R.raw.chunk_project_vertex);
    static public String dithering_fragment = RawShaderLoader.fetch(R.raw.chunk_dithering_fragment);
    static public String dithering_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_dithering_pars_fragment);
    static public String roughnessmap_fragment = RawShaderLoader.fetch(R.raw.chunk_roughnessmap_fragment);
    static public String roughnessmap_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_roughnessmap_pars_fragment);
    static public String shadowmap_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_shadowmap_pars_fragment);
    static public String shadowmap_pars_vertex = RawShaderLoader.fetch(R.raw.chunk_shadowmap_pars_vertex);
    static public String shadowmap_vertex = RawShaderLoader.fetch(R.raw.chunk_shadowmap_vertex);
    static public String shadowmask_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_shadowmask_pars_fragment);
    static public String skinbase_vertex = RawShaderLoader.fetch(R.raw.chunk_skinbase_vertex);
    static public String skinning_pars_vertex = RawShaderLoader.fetch(R.raw.chunk_skinning_pars_vertex);
    static public String skinning_vertex = RawShaderLoader.fetch(R.raw.chunk_skinning_vertex);
    static public String skinnormal_vertex = RawShaderLoader.fetch(R.raw.chunk_skinnormal_vertex);
    static public String specularmap_fragment = RawShaderLoader.fetch(R.raw.chunk_specularmap_fragment);
    static public String specularmap_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_specularmap_pars_fragment);
    static public String tonemapping_fragment = RawShaderLoader.fetch(R.raw.chunk_tonemapping_fragment);
    static public String tonemapping_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_tonemapping_pars_fragment);
    static public String uv_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_uv_pars_fragment);
    static public String uv_pars_vertex = RawShaderLoader.fetch(R.raw.chunk_uv_pars_vertex);
    static public String uv_vertex = RawShaderLoader.fetch(R.raw.chunk_uv_vertex);
    static public String uv2_pars_fragment = RawShaderLoader.fetch(R.raw.chunk_uv2_pars_fragment);
    static public String uv2_pars_vertex = RawShaderLoader.fetch(R.raw.chunk_uv2_pars_vertex);
    static public String uv2_vertex = RawShaderLoader.fetch(R.raw.chunk_uv2_vertex);
    static public String worldpos_vertex = RawShaderLoader.fetch(R.raw.chunk_worldpos_vertex);

    static public String background_frag = RawShaderLoader.fetch(R.raw.lib_background_frag);
    static public String background_vert = RawShaderLoader.fetch(R.raw.lib_background_vert);
    static public String cube_frag = RawShaderLoader.fetch(R.raw.lib_cube_frag);
    static public String cube_vert = RawShaderLoader.fetch(R.raw.lib_cube_vert);
    static public String depth_frag = RawShaderLoader.fetch(R.raw.lib_depth_frag);
    static public String depth_vert = RawShaderLoader.fetch(R.raw.lib_depth_vert);
    static public String distanceRGBA_frag = RawShaderLoader.fetch(R.raw.lib_distance_rgba_frag);
    static public String distanceRGBA_vert = RawShaderLoader.fetch(R.raw.lib_distance_rgba_vert);
    static public String equirect_frag = RawShaderLoader.fetch(R.raw.lib_equirect_frag);
    static public String equirect_vert = RawShaderLoader.fetch(R.raw.lib_equirect_vert);
    static public String linedashed_frag = RawShaderLoader.fetch(R.raw.lib_linedashed_frag);
    static public String linedashed_vert = RawShaderLoader.fetch(R.raw.lib_linedashed_vert);

    static public String line_frag = RawShaderLoader.fetch(R.raw.lib_line_frag);
    static public String line_vert = RawShaderLoader.fetch(R.raw.lib_line_vert);

    static public String meshbasic_frag = RawShaderLoader.fetch(R.raw.lib_meshbasic_frag);
    static public String meshbasic_vert = RawShaderLoader.fetch(R.raw.lib_meshbasic_vert);
    static public String meshlambert_frag = RawShaderLoader.fetch(R.raw.lib_meshlambert_frag);
    static public String meshlambert_vert = RawShaderLoader.fetch(R.raw.lib_meshlambert_vert);
    static public String meshmatcap_frag = RawShaderLoader.fetch(R.raw.lib_meshmatcap_frag);
    static public String meshmatcap_vert = RawShaderLoader.fetch(R.raw.lib_meshmatcap_vert);
    static public String meshphong_frag = RawShaderLoader.fetch(R.raw.lib_meshphong_frag);
    static public String meshphong_vert = RawShaderLoader.fetch(R.raw.lib_meshphong_vert);
    static public String meshphysical_frag = RawShaderLoader.fetch(R.raw.lib_meshphysical_frag);
    static public String meshphysical_vert = RawShaderLoader.fetch(R.raw.lib_meshphysical_vert);
    static public String normal_frag = RawShaderLoader.fetch(R.raw.lib_normal_frag);
    static public String normal_vert = RawShaderLoader.fetch(R.raw.lib_normal_vert);
    static public String points_frag = RawShaderLoader.fetch(R.raw.lib_points_frag);
    static public String points_vert = RawShaderLoader.fetch(R.raw.lib_points_vert);
    static public String shadow_frag = RawShaderLoader.fetch(R.raw.lib_shadow_frag);
    static public String shadow_vert = RawShaderLoader.fetch(R.raw.lib_shadow_vert);
    static public String sprite_frag = RawShaderLoader.fetch(R.raw.lib_sprite_frag);
    static public String sprite_vert = RawShaderLoader.fetch(R.raw.lib_sprite_vert);

    static private HashMap<String, String> map = null;

    static public String lookup(String key) {
        if (map == null) {
            map = new HashMap<>();
            map.put("alphamap_fragment", alphamap_fragment);
            map.put("alphamap_pars_fragment", alphamap_pars_fragment);
            map.put("alphatest_fragment", alphatest_fragment);
            map.put("aomap_fragment", aomap_fragment);
            map.put("aomap_pars_fragment", aomap_pars_fragment);
            map.put("begin_vertex", begin_vertex);
            map.put("beginnormal_vertex", beginnormal_vertex);
            map.put("bsdfs", bsdfs);
            map.put("bumpmap_pars_fragment", bumpmap_pars_fragment);
            map.put("clipping_planes_fragment", clipping_planes_fragment);
            map.put("clipping_planes_pars_fragment", clipping_planes_pars_fragment);
            map.put("clipping_planes_pars_vertex", clipping_planes_pars_vertex);
            map.put("clipping_planes_vertex", clipping_planes_vertex);
            map.put("color_fragment", color_fragment);
            map.put("color_pars_fragment", color_pars_fragment);
            map.put("color_pars_vertex", color_pars_vertex);
            map.put("color_vertex", color_vertex);
            map.put("common", common);
            map.put("cube_uv_reflection_fragment", cube_uv_reflection_fragment);
            map.put("defaultnormal_vertex", defaultnormal_vertex);
            map.put("displacementmap_pars_vertex", displacementmap_pars_vertex);
            map.put("displacementmap_vertex", displacementmap_vertex);
            map.put("emissivemap_fragment", emissivemap_fragment);
            map.put("emissivemap_pars_fragment", emissivemap_pars_fragment);
            map.put("encodings_fragment", encodings_fragment);
            map.put("encodings_pars_fragment", encodings_pars_fragment);
            map.put("envmap_fragment", envmap_fragment);
            map.put("envmap_pars_fragment", envmap_pars_fragment);
            map.put("envmap_pars_vertex", envmap_pars_vertex);
            map.put("envmap_physical_pars_fragment", envmap_physical_pars_fragment);
            map.put("envmap_vertex", envmap_vertex);
            map.put("fog_vertex", fog_vertex);
            map.put("fog_pars_vertex", fog_pars_vertex);
            map.put("fog_fragment", fog_fragment);
            map.put("fog_pars_fragment", fog_pars_fragment);
            map.put("gradientmap_pars_fragment", gradientmap_pars_fragment);
            map.put("lightmap_fragment", lightmap_fragment);
            map.put("lightmap_pars_fragment", lightmap_pars_fragment);
            map.put("lights_lambert_vertex", lights_lambert_vertex);
            map.put("lights_pars_begin", lights_pars_begin);
            map.put("lights_phong_fragment", lights_phong_fragment);
            map.put("lights_phong_pars_fragment", lights_phong_pars_fragment);
            map.put("lights_physical_fragment", lights_physical_fragment);
            map.put("lights_physical_pars_fragment", lights_physical_pars_fragment);
            map.put("lights_fragment_begin", lights_fragment_begin);
            map.put("lights_fragment_maps", lights_fragment_maps);
            map.put("lights_fragment_end", lights_fragment_end);
            map.put("logdepthbuf_fragment", logdepthbuf_fragment);
            map.put("logdepthbuf_pars_fragment", logdepthbuf_pars_fragment);
            map.put("logdepthbuf_pars_vertex", logdepthbuf_pars_vertex);
            map.put("logdepthbuf_vertex", logdepthbuf_vertex);
            map.put("map_fragment", map_fragment);
            map.put("map_pars_fragment", map_pars_fragment);
            map.put("map_particle_fragment", map_particle_fragment);
            map.put("map_particle_pars_fragment", map_particle_pars_fragment);
            map.put("metalnessmap_fragment", metalnessmap_fragment);
            map.put("metalnessmap_pars_fragment", metalnessmap_pars_fragment);
            map.put("morphnormal_vertex", morphnormal_vertex);
            map.put("morphtarget_pars_vertex", morphtarget_pars_vertex);
            map.put("morphtarget_vertex", morphtarget_vertex);
            map.put("normal_fragment_begin", normal_fragment_begin);
            map.put("normal_fragment_maps", normal_fragment_maps);
            map.put("normalmap_pars_fragment", normalmap_pars_fragment);
            map.put("packing", packing);
            map.put("premultiplied_alpha_fragment", premultiplied_alpha_fragment);
            map.put("project_vertex", project_vertex);
            map.put("dithering_fragment", dithering_fragment);
            map.put("dithering_pars_fragment", dithering_pars_fragment);
            map.put("roughnessmap_fragment", roughnessmap_fragment);
            map.put("roughnessmap_pars_fragment", roughnessmap_pars_fragment);
            map.put("shadowmap_pars_fragment", shadowmap_pars_fragment);
            map.put("shadowmap_pars_vertex", shadowmap_pars_vertex);
            map.put("shadowmap_vertex", shadowmap_vertex);
            map.put("shadowmask_pars_fragment", shadowmask_pars_fragment);
            map.put("skinbase_vertex", skinbase_vertex);
            map.put("skinning_pars_vertex", skinning_pars_vertex);
            map.put("skinning_vertex", skinning_vertex);
            map.put("skinnormal_vertex", skinnormal_vertex);
            map.put("specularmap_fragment", specularmap_fragment);
            map.put("specularmap_pars_fragment", specularmap_pars_fragment);
            map.put("tonemapping_fragment", tonemapping_fragment);
            map.put("tonemapping_pars_fragment", tonemapping_pars_fragment);
            map.put("uv_pars_fragment", uv_pars_fragment);
            map.put("uv_pars_vertex", uv_pars_vertex);
            map.put("uv_vertex", uv_vertex);
            map.put("uv2_pars_fragment", uv2_pars_fragment);
            map.put("uv2_pars_vertex", uv2_pars_vertex);
            map.put("uv2_vertex", uv2_vertex);
            map.put("worldpos_vertex", worldpos_vertex);

            map.put("background_frag", background_frag);
            map.put("background_vert", background_vert);
            map.put("cube_frag", cube_frag);
            map.put("cube_vert", cube_vert);
            map.put("depth_frag", depth_frag);
            map.put("depth_vert", depth_vert);
            map.put("distanceRGBA_frag", distanceRGBA_frag);
            map.put("distanceRGBA_vert", distanceRGBA_vert);
            map.put("equirect_frag", equirect_frag);
            map.put("equirect_vert", equirect_vert);
            map.put("linedashed_frag", linedashed_frag);
            map.put("linedashed_vert", linedashed_vert);
            map.put("meshbasic_frag", meshbasic_frag);
            map.put("meshbasic_vert", meshbasic_vert);
            map.put("meshlambert_frag", meshlambert_frag);
            map.put("meshlambert_vert", meshlambert_vert);
            map.put("meshmatcap_frag", meshmatcap_frag);
            map.put("meshmatcap_vert", meshmatcap_vert);
            map.put("meshphong_frag", meshphong_frag);
            map.put("meshphong_vert", meshphong_vert);
            map.put("meshphysical_frag", meshphysical_frag);
            map.put("meshphysical_vert", meshphysical_vert);
            map.put("normal_frag", normal_frag);
            map.put("normal_vert", normal_vert);
            map.put("points_frag", points_frag);
            map.put("points_vert", points_vert);
            map.put("shadow_frag", shadow_frag);
            map.put("shadow_vert", shadow_vert);
            map.put("sprite_frag", sprite_frag);
            map.put("sprite_vert", sprite_vert);

            Iterator iter = map.entrySet().iterator();
            while (iter.hasNext()) {
                Map.Entry<String, String> entry = (Map.Entry<String, String>) iter.next();
                String name = entry.getKey();
                String value = entry.getValue();
                map.put(name, value.substring(1, value.length()-1));
            }
        }
        return map.get(key);
    }
}
